#pragma once

#include "scr_basic_sprite.h"
#include "scr_math.h"

#define SCR_MARINE_FRAME_WIDTH 64
#define SCR_MARINE_FRAME_HEIGHT 64
#define SCR_MARINE_OFFSET_X 32
#define SCR_MARINE_OFFSET_Y 32
#define SCR_MARINE_SPEED_X 4
#define SCR_MARINE_SPEED_Y 4

class SCRMarine
{
public:

	SCRMarine(SCRTexturePtr TextureTop, SCRTexturePtr TextureBottom);
	virtual ~SCRMarine();
	int GetX() const;	
	int GetY() const;
	FX32 GetFixedX() const;
	FX32 GetFixedY() const;
	void SetX(const int& X);
	void SetY(const int& Y);
	void SetXY(const int& X, const int& Y);
	void SetFixedX(const FX32& X);
	void SetFixedY(const FX32& Y);
	void SetFixedXY(const FX32& X, const FX32& Y);
	void Draw();
	void Update();
	FX32 GetAngle() const;

protected:

	FX32 m_FixedX;
	FX32 m_FixedY;
	int m_Angle;
	SCRBasicSprite m_BodyTop;
	SCRBasicSprite m_BodyBottom;
};

inline int SCRMarine::GetX() const
{
	return FXFXToInt(m_FixedX);
}

inline int SCRMarine::GetY() const
{
	return FXFXToInt(m_FixedY);
}

inline FX32 SCRMarine::GetFixedX() const
{
	return m_FixedX;
}

inline FX32 SCRMarine::GetFixedY() const
{
	return m_FixedY;
}

inline void SCRMarine::SetX(const int& X)
{
	m_FixedX = FXIntToFX(X);
}

inline void SCRMarine::SetY(const int& Y)
{
	m_FixedY = FXIntToFX(Y);
}

inline void SCRMarine::SetXY(const int& X, const int& Y)
{
	m_FixedX = FXIntToFX(X);
	m_FixedY = FXIntToFX(Y);
}

inline void SCRMarine::SetFixedX(const FX32& X)
{
	m_FixedX = X;
}

inline void SCRMarine::SetFixedY(const FX32& Y)
{
	m_FixedY = Y;
}

inline void SCRMarine::SetFixedXY(const FX32& X, const FX32& Y)
{
	m_FixedX = X;
	m_FixedY = Y;
}

inline FX32 SCRMarine::GetAngle() const
{
	return m_Angle;
}
